package com.huadao.pda.base;

import android.app.Application;
import android.os.Handler;
import android.os.Looper;

public class BaseApplication extends Application {

    /**
     * 主线程ID
     */
    public static int mMainThreadId = -1;
    /**
     * 主线程
     */
    public static Thread mMainThread;
    /**
     * 主线程Handler
     */
    public static Handler mMainThreadHandler;
    /**
     * 主线程Looper
     */
    public static Looper mMainLooper;
    public static long getMainThreadId() {
        return mMainThreadId;
    }

    public static Handler getMainThreadHandler() {
        return mMainThreadHandler;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mMainThreadId = android.os.Process.myTid();
        mMainThread = Thread.currentThread();
        mMainThreadHandler = new Handler();
        mMainLooper = getMainLooper();
    }
}
